package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.GoodsEntity;
import me.idashu.attg.domain.GroupEntity;
import me.idashu.attg.persistence.CollectionMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CollectionService {
    @Autowired
    private CollectionMapper collectionMapper;
    
    public List<GoodsEntity> getCollectionByMember(int memberId){
    	List<GoodsEntity> listgoods = collectionMapper.getCollectionByMember(memberId);
    	return listgoods;
    }
    
    public List<GoodsEntity> getCollectionByMemberAndPostionGoods(int memberId){
    	List<GoodsEntity> listgoods = collectionMapper.getCollectionByMemberAndPostionGoods(memberId);
    	return listgoods;
    }
    
    public List<GroupEntity> getCollectionByMemberAndPostionGroup(int memberId){
    	List<GroupEntity> listgroup = collectionMapper.getCollectionByMemberAndPostionGroup(memberId);
    	return listgroup;
    }
    
    public void deleteCollectionByGoodsId(Map<String,Object> map){
    	collectionMapper.deleteCollectionByGoodsId(map);
    }
    
    public void insertCollection(Map<String,Object> map){
    	collectionMapper.insertCollection(map);
    }
    
    public int getCollectionIsExist(Map<String,Object> map){
    	int count = collectionMapper.getCollectionIsExist(map);
    	return count;
    }
    
}
